/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package actioncombination.problem.gridworld;

import actioncombination.logic.agent.*;
import actioncombination.problem.gridworld.AgentStateImpl;
import actioncombination.logic.environment.Environment;
import actioncombination.logic.environment.RLEnvironment;





/**
 *
 * @author Administrador
 */
public class PerceptionImpl extends Perception {

    public static final int PERCEPTION_VOID = 0;
    public static final int PERCEPTION_START= 1;
    public static final int PERCEPTION_TARGET = 2;
    public static final int PERCEPTION_END = 3;
    public static final int PERCEPTION_OUT=4;
    public static final int PERCEPTION_HOLE=5;
    private int sensor;

    @Override
    public void initPerception(Agent agent, Environment environment) {
        RLAgent agente = (RLAgent) agent;
        RLEnvironment ambiente = (RLEnvironment ) environment;

        int fil = (int) ((AgentStateImpl) agente.getAgentState()).getPosition().getX();
        int col = (int) ((AgentStateImpl) agente.getAgentState()).getPosition().getY();

        setSensor(ambiente.getHere(fil, col));
       
    }

    @Override
    public String toString() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    public int getSensor() {
        return sensor;
    }

    public void setSensor(int sensor) {
        this.sensor = sensor;
    }


   
}
